package com.ruimei.service.impl;

import com.ruimei.entitys.Teacher;
import com.ruimei.mapper.TeacherMapper;
import com.ruimei.service.TeacherService;
import com.ruimei.util.ifUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Resource
    TeacherMapper mapper;

    @Override
    public Map<String, Object> getTeacherInfo(Teacher teacher) {
        Map<String, Object> map = new HashMap();
        Teacher user = mapper.getTeacherInfo(teacher);
        map.put("status", Boolean.valueOf(true));
        map.put("message", "查询成功");
        map.put("data", user);
        return map;
    }

    @Override
    public Map<String, Object> setTeacherInfo(Teacher teacher) {
        Integer i = mapper.setTeacherInfo(teacher);
        return ifUtil.YesOrNo(i);
    }
}
